package com.wsc.juc_001.c_000;

public class ThreadState {
    static class MyThread extends Thread{
        public void run(){
            System.out.println(this.getState());
            for (int i = 0; i <10 ; i++) {

                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(i);
            }

        }
    }

    public static void main(String[] args) {
       MyThread t1 =  new MyThread();
        System.out.println(t1.getState());

        t1.start();

        System.out.println(t1.getState());
        try {
            t1.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        System.out.println(t1.getState());
    }
}
